package matrix;

import model.RoomModel;
import utils.Point3D;

public class GraphNode
{
	private final int ID;
	private String name;
	private Point3D position;
	private GraphNodeType type;
	private RoomModel room;
	
	public GraphNode(int ID, RoomModel room, Point3D position)
	{
		this.setRoom(room);
		this.name = "";
		this.ID = room.getID() * 100 + ID;
		this.setPosition(position);
	}

	public GraphNode(RoomModel room) {
		this(room.getID(), room, room.getCenter());
	}

	public Point3D getPosition() {
		return Point3D.sum(this.room.getPosition(), this.position);
	}

	public void setPosition(Point3D position) {
		this.position = position;
	}

	public int getID() {
		return ID;
	}

	public GraphNodeType getType() {
		return type;
	}

	public void setType(GraphNodeType type) {
		this.type = type;
	}

	public RoomModel getRoom() {
		return room;
	}

	public void setRoom(RoomModel room) {
		this.room = room;
	}
	
	public String toString()
	{
		return "[" + this.room + " / " + this.ID + "]";
	}

	public String getName() {
		// TODO Auto-generated method stub
		return this.name;
	}
	
	public void setName(String value)
	{
		this.name = value;
	}
}
